<?php
class Login extends AppModel
{
    var $name = 'Login';
    var $useTable = 'users'; 
    var $validate = array(
     			'name' => array(
     				'rule1' => array('rule' => 'isUnique','message' => 'このユーザ名はすでに使用されています。'),
     				'rule2' => array('rule' => VALID_NOT_EMPTY, 'message' => 'ユーザ名を入力してください'),
     			),
                'password' => array('rule' => VALID_NOT_EMPTY, 'message' => 'パスワードを入力してくだっさい')
     );
	function beforeSave() {
		debug($this->data['Login']);
		unset($this->data['Login']['password']);
		/*
		if(!empty($this->data['Login']['password'])){
			$this->data['Login']['password'] =  sha1($this->data['Login']['password']);
			debug($this->data['Login']);
			return true;
		}else{
			return true;
		}
		*/
	}
}
?> 